﻿<Window x:Class="DocumentManagement.AddDocumentIn"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:vm="clr-namespace:DocumentManagement.ViewsModels"
        
        Title="AddDocumentIn" Height="768" Width="1024" Loaded="Window_Loaded" WindowStartupLocation="CenterScreen">
    
    <Window.Resources>
        <vm:AddDocumentInViewsModel x:Key="addDocumentInViewsModel"/>

        <ContextMenu x:Key="MyContextMenu">
            <MenuItem Header="ลบไฟล์หนังสือเข้า" Name="deleteINDocMenu" Click="deleteINDocMenu_Click" />
        </ContextMenu>
        
    </Window.Resources>
    
    <Grid DataContext="{Binding Source={StaticResource addDocumentInViewsModel}}">
        <Grid.RowDefinitions>
            <RowDefinition Height="70" />
            <RowDefinition Height="42" />
            <RowDefinition Height="42" />
            <RowDefinition Height="42" />
            <RowDefinition Height="42" />
            <RowDefinition Height="42" />
            <RowDefinition Height="42" />
            <RowDefinition Height="42" />
            <RowDefinition Height="42" />
            <RowDefinition Height="42" />
            <RowDefinition Height="100" />
            <RowDefinition Height="42" />
            <RowDefinition Height="602*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="350*" />
            <ColumnDefinition Width="652*" />
        </Grid.ColumnDefinitions>
        <StackPanel Grid.Row="1" Name="stackPanel2" Orientation="Horizontal">
            <TextBlock FontFamily="Tahoma" FontSize="14" Height="23" Name="textBlock3" Text="ชนิดหนังสือ :" TextAlignment="Right" Width="119" />
            <GroupBox Height="33" Name="groupBox2" Width="210" Margin="10,0,0,0">
                <Grid Height="31">
                    <RadioButton  Content="ภายนอก" FontFamily="Tahoma" FontSize="14" Height="25" HorizontalAlignment="Left" IsEnabled="True" Margin="6,6,0,0" Name="StatusDocRadioButton1" TabIndex="1" VerticalAlignment="Top" IsChecked="{Binding Path=MyStatusDoc1, Mode=TwoWay}" Checked="StatusDocRadioButton1_Checked" />
                    <RadioButton  Content="ภายใน" FontFamily="Tahoma" FontSize="14" Height="25" HorizontalAlignment="Right" Margin="0,6,37,0" Name="StatusDocRadioButton2" TabIndex="2" VerticalAlignment="Top" IsChecked="{Binding Path=MyStatusDoc2, Mode=TwoWay}" Checked="StatusDocRadioButton2_Checked" />
                </Grid>
            </GroupBox>
        </StackPanel>
        <StackPanel Grid.Column="1" Grid.Row="1" Name="stackPanel3" Orientation="Horizontal" HorizontalAlignment="Left" Margin="0,0,0,1" Grid.RowSpan="2">
            <TextBlock FontSize="14" Height="27" Name="textBlock19" Text="ชื่อเรื่อง :" TextAlignment="Right" Width="124" FontFamily="Tahoma" />
            <TextBox FontSize="14" Height="72" Name="TitletextBox" Text="{Binding Path=MyReceive.Title, Mode=TwoWay}" Width="440" Margin="10,0,0,0" TabIndex="6" TextWrapping="Wrap" FontFamily="Tahoma" />
        </StackPanel>
        <StackPanel Grid.Row="3" Name="stackPanel4" Orientation="Horizontal">
            <TextBlock FontFamily="Tahoma" FontSize="14" Height="23" Name="textBlock14" Text="วันที่ลงรับ :" TextAlignment="Right" Width="120" />
            <StackPanel Height="30" Name="stackPanel16" Width="200" Margin="10,0,0,0">
                <DatePicker FontFamily="Tahoma" FontSize="14" Height="30" HorizontalAlignment="Left" Margin="0" Name="ReceiveDatePicker" SelectedDate="{Binding Path=MyReceive.ReceiveDate, Mode=TwoWay}" TabIndex="1" Width="120" DisplayDate="2/28/2013" />
            </StackPanel>
        </StackPanel>
        <StackPanel Grid.Row="4" Name="stackPanel5" Orientation="Horizontal">
            <TextBlock FontFamily="Tahoma" FontSize="14" Height="23" Name="textBlock15" Text="วันที่ในหนังสือรับ :" TextAlignment="Right" Width="120" />
            <StackPanel Height="30" Name="stackPanel17" Width="200" Margin="10,0,0,0">
                <DatePicker FontFamily="Tahoma" FontSize="14" Height="30" HorizontalAlignment="Left" Name="DocumentDatePicker" SelectedDate="{Binding Path=MyReceive.DocumentDate, Mode=TwoWay}" TabIndex="2" Width="120" DisplayDate="2/28/2556" />
            </StackPanel>
        </StackPanel>
        <StackPanel Grid.Row="2" Name="stackPanel6" Orientation="Horizontal">
            <TextBlock FontFamily="Tahoma" FontSize="14" Height="23" Name="textBlock13" Text="รหัสลงรับ :" TextAlignment="Right" Width="120" />
            <TextBox FontFamily="Tahoma" FontSize="14" Height="31" IsEnabled="False" Name="ReceiveCodetextBox" Text="{Binding Path=MyReceive.ReceiveCode, Mode=TwoWay}" Width="200" Margin="10,0,0,0" />
        </StackPanel>
        <StackPanel Grid.Column="1" Grid.Row="3" Name="stackPanel7" Orientation="Horizontal">
            <TextBlock FontSize="14" Height="23" Name="textBlock20" Text="ชั้นความเร็วหนังสือ :" TextAlignment="Right" Width="124" FontFamily="Tahoma" />
            <GroupBox Height="33" Name="groupBox3" Width="299" Margin="10,0,0,0">
                <Grid Height="31">
                    <RadioButton Content="ปกติ" FontSize="14" Height="20" HorizontalAlignment="Left" IsChecked="{Binding Path=MySpeed1, Mode=TwoWay}" IsEnabled="True" Margin="6,6,0,0" Name="SpeedRadio1" VerticalAlignment="Top" TabIndex="7" IsTabStop="True" FontFamily="Tahoma" />
                    <RadioButton Content="ด่วน" FontSize="14" Height="20" HorizontalAlignment="Left" IsChecked="{Binding Path=MySpeed2, Mode=TwoWay}" Margin="59,6,0,0" Name="SpeedRadio2" VerticalAlignment="Top" TabIndex="8" FontFamily="Tahoma" />
                    <RadioButton Content="ด่วนมาก" FontSize="14" Height="20" HorizontalAlignment="Left" IsChecked="{Binding Path=MySpeed3, Mode=TwoWay}" Margin="107,6,0,0" Name="SpeedRadio3" VerticalAlignment="Top" TabIndex="9" FontFamily="Tahoma" />
                    <RadioButton Content="ด่วนที่สุด" FontSize="14" Height="22" HorizontalAlignment="Left" IsChecked="{Binding Path=MySpeed4, Mode=TwoWay}" Margin="179,6,0,0" Name="SpeedRadio4" VerticalAlignment="Top" TabIndex="10" FontFamily="Tahoma" />
                </Grid>
            </GroupBox>
        </StackPanel>
        <StackPanel Grid.Column="1" Grid.Row="5" Name="stackPanel8" Orientation="Horizontal" Grid.RowSpan="2">
            <TextBlock FontSize="14" Height="28" Name="textBlock22" Text="หมายเหตุ :" TextAlignment="Right" Width="124" FontFamily="Tahoma" />
            <TextBox FontSize="14" Height="76" Name="DescriptiontextBox" Text="{Binding Path=MyReceive.Description, Mode=TwoWay}" Width="439" Margin="10,0,0,0" TabIndex="13" TextWrapping="Wrap" FontFamily="Tahoma" />
        </StackPanel>
        <StackPanel Grid.Row="5" Name="stackPanel9" Orientation="Horizontal">
            <!--<ComboBox DisplayMemberPath="ThaiName" FontSize="14" Height="33" ItemsSource="{Binding Path=EntityModels.Divisions}" Name="FormDivisionIDcomboBox" SelectedValue="{Binding Path=MyReceive.FromDivisionID, Mode=TwoWay}" SelectedValuePath="DivisionID" Width="199" Margin="10,0,0,0" />-->
            <TextBlock FontFamily="Tahoma" FontSize="14" Height="23" Name="textBlock16" Text="เลขที่หนังสือ :" TextAlignment="Right" Width="120" />
            <TextBox FontFamily="Tahoma" FontSize="14" Height="30" Name="DocumentCodetextBox" TabIndex="3" Text="{Binding Path=MyReceive.DocumentCode, Mode=TwoWay}" Width="200" Margin="10,0,0,0" />
        </StackPanel>
        <StackPanel Grid.Row="6" Name="stackPanel10" Orientation="Horizontal">
            <!--<ComboBox DisplayMemberPath="ThaiName" FontSize="14" Height="31" ItemsSource="{Binding Path=EntityModels.Divisions}" Name="ToDivisionIDcomboBox" SelectedValue="{Binding Path=MyReceive.ToDivisionID, Mode=TwoWay}" SelectedValuePath="DivisionID" Width="200" Margin="10,0,0,0" />-->
            <TextBlock FontFamily="Tahoma" FontSize="14" Height="23" Name="textBlock17" Text="จากหน่วยงาน :" TextAlignment="Right" Width="120" />
            <ComboBox DisplayMemberPath="ThaiName" FontFamily="Tahoma" FontSize="14" Height="28" ItemsSource="{Binding Path=EntityModels.Divisions}" Name="FormDivisionIDcomboBox" SelectedValue="{Binding Path=MyReceive.FormDivisionID, Mode=TwoWay}" TabIndex="4" Width="199" Margin="10,0,0,0" SelectedValuePath="DivisionID" IsEditable="True" IsTextSearchEnabled="True" StaysOpenOnEdit="True" />
        </StackPanel>
        <StackPanel Grid.Column="1" Grid.Row="7" Name="stackPanel11" Grid.RowSpan="3" Orientation="Horizontal">
            <TextBlock FontSize="14" Height="26" Name="textBlock24" Text="รายการไฟล์แนบ :" TextAlignment="Right" Width="124" FontFamily="Tahoma" />
            <DataGrid AutoGenerateColumns="False" CanUserAddRows="True" ContextMenu="{StaticResource MyContextMenu}" FontSize="14" Height="123" IsReadOnly="True" ItemsSource="{Binding Path=AttachICV, Mode=TwoWay}" Name="dataGriListFileDataGrid" SelectedItem="{Binding Path=SelectedAttachFile, Mode=TwoWay}" Width="351" Margin="10,0,0,0" FontFamily="Tahoma">
                <DataGrid.Columns>
                    <!--<DataGridTextColumn Binding="{Binding Path=ReceiveAttachedFileID}" Header="รหัสไฟล์" />-->
                    <DataGridTextColumn Binding="{Binding Path=FileName}" Header="ชื่อไฟล์" />
                    <!--<DataGridTextColumn Binding="{Binding Path=Active}" Header="Active" />
                    <DataGridTextColumn Binding="{Binding Path=ReceiveID, Mode=TwoWay}" Header="Header" />-->
                </DataGrid.Columns>
            </DataGrid>
            <Button Content="Browse" FontSize="14" Height="29" Name="BrowseButton" Width="75" Click="BrowseButton_Click" Margin="10,0,0,0" TabIndex="14" FontFamily="Tahoma" FontWeight="Bold" />
        </StackPanel>
        <StackPanel Grid.Column="1" Grid.Row="4" Name="stackPanel13" Orientation="Horizontal">
            <TextBlock FontSize="14" Height="23" Name="textBlock1" Text="การปฏิบัติ :" TextAlignment="Right" Width="124" FontFamily="Tahoma" />
            <GroupBox Height="33" Name="groupBox1" Width="299" Margin="10,0,0,0">
                <Grid Height="31">
                    <RadioButton Content="อยู่ระหว่างดำเนินการ" FontSize="14" Height="26" HorizontalAlignment="Left" IsEnabled="True" Margin="6,5,0,0" Name="ActionRadioButton1" VerticalAlignment="Top" IsChecked="{Binding Path=MyAction1}" TabIndex="11" FontFamily="Tahoma" />
                    <RadioButton Content="ดำเนินการเรียบร้อย" FontSize="14" Height="20" HorizontalAlignment="Left" IsChecked="{Binding Path=MyAction2, Mode=TwoWay}" Margin="147,5,0,0" Name="ActionRadioButton2" VerticalAlignment="Top" TabIndex="12" FontFamily="Tahoma" />
                </Grid>
            </GroupBox>
        </StackPanel>
       
        <StackPanel Grid.Row="10" Name="stackPanel14" Grid.ColumnSpan="2" Orientation="Horizontal">
            <Button Content="บันทึก" FontSize="14" Height="29" Name="SaveButton" Width="75" Margin="400,0,0,0" Click="SaveButton_Click" TabIndex="15" FontFamily="Tahoma" FontWeight="Bold" />
            <Button Content="ยกเลิก" FontSize="14" Height="29" Name="CancelButton" Width="75" Margin="50,0,0,0" Click="CancelButton_Click" TabIndex="16" FontFamily="Tahoma" FontWeight="Bold" />
        </StackPanel>
        <StackPanel Name="stackPanel1" Grid.ColumnSpan="2" Orientation="Horizontal">
            <TextBlock FontSize="18" Height="29" Name="textBlock2" Text="เพิ่มข้อมูลหนังสือเข้า" TextAlignment="Center" Width="1001" FontFamily="Tahoma" FontWeight="Bold" />
        </StackPanel>
        <StackPanel Grid.Row="7" Name="stackPanel12" Orientation="Horizontal">
            <TextBlock FontFamily="Tahoma" FontSize="14" Height="23" Name="textBlock18" Text="ถึงหน่วยงาน :" TextAlignment="Right" Width="120" />
          
                <ComboBox DisplayMemberPath="ThaiName" FontFamily="Tahoma" FontSize="14" Height="28" ItemsSource="{Binding Path=EntityModels.Divisions}" Name="ToDivisionIDcomboBox" SelectedValue="{Binding Path=MyReceive.ToDivisionID, Mode=TwoWay}" SelectedValuePath="DivisionID" TabIndex="5" Width="200" Margin="10,0,0,0" />
            <!--<ctr:AutoComplete x:Name="autoCities" SelectedValuePath="CityID" DisplayMemberPath="Name" 
                          PatternChanged="autoCities_PatternChanged" 
                          Delay="500" />-->
        </StackPanel>
    </Grid>
</Window>
